package com.zhuangjie.coupon.enums;

import com.zhuangjie.mvc.validator.annotate.enum_valid.VerifiableEnum;

/**
 * 优惠卷适用类型
 */
public enum CouponApplicationType implements VerifiableEnum {
    NO_LIMIT((byte) 0, "无适用限制"),
    APPLICABLE_CATEGORY((byte) 1, "适用类别"),
    APPLICABLE_GOODS((byte) 2, "适用商品");

    private final byte code;
    private final String name;

    CouponApplicationType(byte code, String name) {
        this.code = code;
        this.name = name;
    }

    public byte getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    @Override
    public byte getValue() {
        return getCode();
    }
}